package cn.itsource.ymcc.web.controller;

import cn.itsource.result.JSONResult;
import cn.itsource.ymcc.dto.UserDto;
import cn.itsource.ymcc.service.ILoginLogService;
import cn.itsource.ymcc.service.ILoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/lr")
public class LoginAndRegisterController {
    @Autowired
    private ILoginService loginService;

    /**
     * 前台和后台统一认证 的接口
     * @param userDto
     * @return
     */
    @PostMapping("/accountLogin")
    public JSONResult accountLogin(@RequestBody UserDto userDto){
        return loginService.accountLogin(userDto);
    }

}
